<cfquery name="load_calendar" datasource="#request.dsn#">
SELECT b_postedon,(day(b_postedon)) AS getthisday
FROM  blog_posts 
WHERE  (b_postedon >= #CreateDate(Year(DateOb),Month(DateOb),1)#) and (b_postedon <= #CreateDate(Year(DateOb),Month(DateOb),DaysInMonth(DateOb))#)
<cfif NOT pid IS 0>AND userid = #pid#</cfif>
</cfquery>

<cfquery name="qrygetyears" datasource="#request.dsn#">
SELECT DISTINCT (year(b_postedon)) AS blog_year
FROM  blog_posts 
</cfquery>